<template>
  <ModalFull
    v-bind="$attrs"
    :inner-loading="userInnerLoading"
    :before-change="useBeforeChange"
    :model="fields"
    :rules="rules"
  >
    <a-form
      ref="formRef"
      :label-col="{ style: { width: '170px' } }"
      :wrapper-col="{ span: 24 }"
    >
      <Section title="基础信息">
        <a-row>
          <a-col :span="12" style="row-gap: 16px">
            <a-form-item label="姓名" name="a0001">
              <a-input
                v-model:value="fields.a0001"
                placeholder="请输入教授姓名"
              />
            </a-form-item>
            <a-form-item label="性别" name="a0002">
              <Gender v-model:value="fields.a0002" />
            </a-form-item>
            <a-form-item label="国籍" name="a0003">
              <a-select v-model:value="fields.a0003" placeholder="请选择国籍" />
            </a-form-item>
            <a-form-item name="a0004">
              <template #label>联系邮箱/教师端账号</template>
              <a-input v-model:value="fields.a0004" placeholder="请输入邮箱" />
            </a-form-item>
            <a-form-item label="合作阶段" name="a0005">
              <Select
                v-model:value="fields.a0005"
                :options="cooperationStageOption"
                placeholder="请选择合作阶段"
              />
            </a-form-item>
            <a-form-item label="美国办负责人" name="a0006">
              <a-select v-model:value="fields.a0006" placeholder="请选择国籍" />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="头像" name="a0007">
              <UploadImage
                cropper
                width="120px"
                height="120px"
                :size="10"
                :params="{ businessType: 'Q00200004' }"
                default-value="http://192.168.110.179:9000/neo-system/577f4753-15c8-4fe0-a756-598a818ad0c0.png"
                :before-change="useUploadImageBeforeChange"
              />
              <UploadFiles :before-change="useUploadFilesBeforeChange" />
            </a-form-item>
            <a-form-item label="联系电话" name="a0008">
              <a-input
                v-model:value="fields.a0008"
                placeholder="请输入教授姓名"
              />
            </a-form-item>
            <a-form-item label="支持讲座" name="a0009">
              <Select
                v-model:value="fields.a0009"
                :options="supportingLecturesOption"
                placeholder="请选择国籍"
              />
            </a-form-item>
            <a-form-item label="学术老师" name="a00010">
              <a-select
                v-model:value="fields.a00010"
                placeholder="请选择国籍"
              />
            </a-form-item>
          </a-col>
        </a-row>
      </Section>

      <Section title="任职信息">
        <a-row>
          <a-col :span="12">
            <a-form-item label="任职院校" name="a00011">
              <a-select
                v-model:value="fields.a00011"
                placeholder="请选择国籍"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="任职专业" name="a00012">
              <a-select
                v-model:value="fields.a00012"
                placeholder="请选择国籍"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="学历" name="a00013">
              <Select
                v-model:value="fields.a00013"
                :options="educationOption"
                placeholder="学历"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="级别" name="a00014">
              <Select
                v-model:value="fields.a00014"
                :options="teacherLevelOption"
                placeholder="学历"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="职位（中文）" name="a00015">
              <a-input
                v-model:value="fields.a00015"
                placeholder="请输入教授姓名"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="职位（英文）" name="a00016">
              <a-input
                v-model:value="fields.a00016"
                placeholder="请输入教授姓名"
              />
            </a-form-item>
          </a-col>
        </a-row>
      </Section>

      <Section title="教学信息">
        <a-row>
          <a-col :span="24">
            <a-form-item name="a00017">
              <template #label>推荐信成绩要求与注意事项</template>
              <a-input
                v-model:value="fields.a00017"
                placeholder="请输入教授姓名"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="推荐信可用EDU邮箱" name="a00018">
              <Whether v-model:value="fields.a00018" />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="是否提交本校申请" name="a00019">
              <Whether v-model:value="fields.a00019" />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="是否录屏" name="a00020">
              <Whether v-model:value="fields.a00020" />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="是否接受1V1" name="a00021">
              <Whether v-model:value="fields.a00021" />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="结课形式" name="a00022">
              <a-select
                v-model:value="fields.a00022"
                placeholder="请选择国籍"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="教授评级" name="a00023">
              <a-select
                v-model:value="fields.a00023"
                placeholder="请选择国籍"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="上课时段偏好" name="a00024">
              <a-input
                v-model:value="fields.a00024"
                placeholder="请输入教授姓名"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="教授特点/打分偏好" name="a00025">
              <a-input
                v-model:value="fields.a00025"
                placeholder="请输入教授姓名"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="宣传/炸群话术" name="a00026">
              <a-input
                v-model:value="fields.a00026"
                placeholder="请输入教授姓名"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="往期培训资料" name="a00027">
              <a-input
                v-model:value="fields.a00027"
                placeholder="请输入教授姓名"
              />
            </a-form-item>
          </a-col>
        </a-row>
      </Section>
      <Section title="拓展信息">
        <a-row>
          <a-col :span="12">
            <a-form-item label="擅长领域" name="a00028">
              <a-input
                v-model:value="fields.a00028"
                placeholder="请输入擅长领域"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="印象评价" name="a00029">
              <a-input
                v-model:value="fields.a00029"
                placeholder="请输入擅长领域"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="简介（中文）" name="a00030">
              <Editor
                v-model:value="fields.a00030"
                :default-value="state.a00030"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="简介（英文）" name="a00031">
              <Editor
                v-model:value="fields.a00031"
                :default-value="state.a00031"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="研究方向（中文）" name="a00032">
              <Editor
                v-model:value="fields.a00032"
                :default-value="state.a00032"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="研究方向（英文）" name="a00033">
              <Editor
                v-model:value="fields.a00033"
                :default-value="state.a00033"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="往期学员论文（中文）" name="a00034">
              <Editor
                v-model:value="fields.a00034"
                :default-value="state.a00034"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="往期学员论文（英文）" name="a00035">
              <Editor
                v-model:value="fields.a00035"
                :default-value="state.a00035"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="主页URL" name="a00036">
              <a-input v-model:value="fields.a00036" placeholder="请输入" />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="介绍视频URL" name="a00037">
              <a-input v-model:value="fields.a00037" placeholder="请输入" />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="讲座视频URL" name="a00038">
              <a-input v-model:value="fields.a00038" placeholder="请输入" />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="微信推文URL" name="a00039">
              <a-input v-model:value="fields.a00039" placeholder="请输入" />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="备注" name="a00040">
              <a-textarea v-model:value="fields.a00040" placeholder="请输入" />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="简历" name="a00041">
              <a-textarea v-model:value="fields.a00041" placeholder="请输入" />
            </a-form-item>
          </a-col>
        </a-row>
      </Section>
    </a-form>
  </ModalFull>
</template>
<script lang="ts" setup>
import { ref, Ref } from "vue";
import type { FormInstance } from "ant-design-vue";
import ModalFull from "@/components/modalFull/index.vue";
import Section from "@/components/section/index.vue";
import Whether from "@/components/whether/index.vue";
import Gender from "@/components/gender/index.vue";
import Select from "@/components/select/index.vue";
import Editor from "@/components/editor/index.vue";
import UploadImage from "@/components/uploadImage/index.vue";
import UploadFiles from "@/components/upload/index.vue";
import { useFormMoudel } from "./use-form";
import { useUploadImage } from "@/hook/index";
import { useEnum } from "@/enum/index";
//ref
const formRef = ref<FormInstance>();
// 解构
const { useUploadImageBeforeChange, useUploadFilesBeforeChange } =
  useUploadImage();
const { userInnerLoading, useBeforeChange, fields, rules, state } =
  useFormMoudel(formRef);
// 学历
const educationOption = useEnum("classEndingModule");
// 合作阶段
const cooperationStageOption = useEnum("cooperationStageModule");
// 支持讲座
const supportingLecturesOption = useEnum("supportingLecturesModule");
// 教师级别
const teacherLevelOption = useEnum("teacherLevelModule");
</script>
